const pkg = require('../../package.json')
const isDevelopment = process.env.RUNTIME === 'development'
const isUAT = process.env.RUNTIME === 'uat'

const config = {
  // 网站通用设置
  website: {
    version: pkg.version,
    buildVersion: process.env.BUILD_VERSION,
    name: 'JVFast管理系统',
    shortName: 'JVF',
    desc: 'JVFast是最敏捷的前后端脚手架系统快速解决方案',
    url: 'https://jvfast.pingbook.top',
    helpUrl: 'https://jvfast.pingbook.top',
    beian: '沪ICP备19010939号-1',
    enableAds: !isDevelopment,
    enableAPPDownload: true,
    appDownloadUrl: 'https://www.baidu.com'
  },
  permission: {
    superAdmin: 'admin',
    superPermission: '*:*:*'
  },
  page: {
    loginComponentName: 'login',
    changePwdComponentName: 'changepwd-code',
    error401ComponentName: 'error401',
    homeComponentName: 'index',
    lockComponentName: 'lock',
    // 直接访问页面
    ignoreComponentName: [
      'lock',
      'index-iframe',
      'index-help',
      'index-profile-basic',
      'index-profile-feedback',
      'index-profile-notification',
      'index-profile-security'
    ]
  },
  defaultPasswd: '123456',
  // google adsense账号id
  googleAdsenseId: 'ca-pub-1893384651266286',
  googleTagManagerId: '',
  // token对应的header值,对应后台接口设置的header
  tokenHeader: 'X-Token',
  tokenRefreshHeader: 'X-Token',
  // 是否数据都要加密
  secretEnabled: false,
  secretKey: 'b2c17b46e2b13s5392aab5a82869856c',
  // vuex持久化存放值键
  storeEncrypted: !isDevelopment,
  storeKey: pkg.name,
  // 加载所有的iconfont资源
  iconfont: ['font_1529202_0ms2l5eu5dk'],
  // 高德地图组件
  AMAP_JS_KEY: '9e84bb4624b3c37448d15a7672800563',
  // 服务请求配置
  serverUrls: {
    API_BASE_URL: isDevelopment ? 'http://127.0.0.1:9090/jvfast-service' : (isUAT ? 'https://open.pingbook.top/jvfast-service' : 'https://open.pingbook.top/jvfast-service'),
    STATIC_BASE_URL: isDevelopment ? 'https://res.yitieyilu.com/upload/' : (isUAT ? 'https://res.pingbook.top/jvfast-service' : 'https://res.pingbook.top/jvfast-service'),
    CDN_BASE_URL: isDevelopment ? '/res/' : 'https://res.yitieyilu.com/assets/b2b36bebdb95946fa/'
  }
}
export default config
